<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>后台信息管理系统</title>
    <link th:href="@{../../css/bootstrap.min.css}" rel="stylesheet" />
    <link th:href="@{../../font-awesome/css/font-awesome.css}" rel="stylesheet" />
    <link th:href="@{../../css/styleManage.css}" rel="stylesheet" />

    <link th:href="@{../../css/plugins/iCheck/custom.css}" rel="stylesheet"/>
    <link th:href="@{../../css/plugins/footable/footable.core.css}" rel="stylesheet"/>


    <!-- datetimepicker -->
    <link th:href="@{../../css/bootstrap-datetimepicker.css}" rel="stylesheet" media="screen"/>
    <link th:href="@{../../css/bootstrap-datetimepicker.min.css}" rel="stylesheet" media="screen"/>

</head>
<body>
<div id="wrapper">
    <nav class="navbar-default navbar-static-side" role="navigation" th:include="/manage/nav :: navigation"></nav>
    <div id="page-wrapper" class="gray-bg">
        <div class="border-bottom" th:include="/manage/header :: headerTop"></div>
        <div class="row wrapper border-bottom white-bg page-heading" th:fragment="headerNav">
            <div class="col-lg-10">
                <h2>订单管理</h2>
                <ol class="breadcrumb">
                    <li>
                        <a th:href="@{/manage/orderControl}">首页</a>
                    </li>
                    <li>
                        <a th:href="@{/manage/orderControl}">订单管理</a>
                    </li>
                    <li class="active">
                        <strong>订单详情</strong>
                    </li>
                </ol>
            </div>
            <div class="col-lg-2">
            </div>
        </div>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>订单详情</h5>
                            <div class="ibox-tools">
                                <a class="collapse-link">
                                    <i class="fa fa-chevron-up"></i>
                                </a>
                            </div>
                        </div>
                        <div class="ibox-content">
                        <table class=" table table-hover" data-page-size="10">
                            <tr>
                                <th colspan="2">orderId:</th>
                            </tr>
                            <tr>
                                <td th:text="${session.order.orderId}"></td>
                                <td th:text="${#dates.format(session.order.orderDate, 'yyyy-MM-dd HH:mm')}">money</td>
                            </tr>
                            <tr>
                                <th colspan="2">Payment Details</th>
                            </tr>
                            <tr>
                                <td>Card Type:</td>
                                <td th:text="${session.order.cardType}" >Card</td>
                            </tr>
                            <tr>
                                <td>Card Number:</td>
                                <td th:text="${session.order.creditCard}" > * Fake
                                    number</td>
                            </tr>
                            <tr>
                                <td>Expiry Date (MM/YYYY):</td>
                                <td th:text="${session.order.expiryDate}" ></td>
                            </tr>
                            <tr>
                                <th colspan="2">Billing Address</th>
                            </tr>
                            <tr>
                                <td>First name:</td>
                                <td th:text="${session.order.billToFirstName}" ></td>
                            </tr>
                            <tr>
                                <td>Last name:</td>
                                <td th:text="${session.order.billToLastName}" ></td>
                            </tr>
                            <tr>
                                <td>Address 1:</td>
                                <td th:text="${session.order.billAddress1}" ></td>
                            </tr>
                            <tr>
                                <td>Address 2:</td>
                                <td th:text="${session.order.billAddress2}" ></td>
                            </tr>
                            <tr>
                                <td>City:</td>
                                <td th:text="${session.order.billCity}" ></td>
                            </tr>
                            <tr>
                                <td>State:</td>
                                <td th:text="${session.order.billState}" ></td>
                            </tr>
                            <tr>
                                <td>Zip:</td>
                                <td th:text="${session.order.billZip}" ></td>
                            </tr>
                            <tr>
                                <td>Country:</td>
                                <td th:text="${session.order.billCountry}" ></td>
                            </tr>
                            <tr>
                                <th colspan="2">Shipping Address</th>
                            </tr>
                            <tr>
                                <td>First name:</td>
                                <td th:text="${session.order.shipToFirstName}" ></td>
                            </tr>
                            <tr>
                                <td>Last name:</td>
                                <td th:text="${session.order.shipToLastName}" ></td>
                            </tr>
                            <tr>
                                <td>Address 1:</td>
                                <td th:text="${session.order.shipAddress1}" ></td>
                            </tr>
                            <tr>
                                <td>Address 2:</td>
                                <td th:text="${session.order.shipAddress2}" ></td>
                            </tr>
                            <tr>
                                <td>City:</td>
                                <td th:text="${session.order.shipCity}" ></td>
                            </tr>
                            <tr>
                                <td>State:</td>
                                <td th:text="${session.order.shipState}" ></td>
                            </tr>
                            <tr>
                                <td>Zip:</td>
                                <td th:text="${session.order.shipZip}" ></td>
                            </tr>
                            <tr>
                                <td>Country:</td>
                                <td th:text="${session.order.shipCountry}" ></td>
                            </tr>
                            <tr>
                                <td>Courier:</td>
                                <td th:text="${session.order.courier}" ></td>
                            </tr>
                            <tr>
                                <td>Status:</td>
                                <td th:text="${session.order.status}" ></td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <table class=" table table-hover" data-page-size="10">
                                        <tr>
                                            <th>Item ID</th>
                                            <th>Description</th>
                                            <th>Quantity</th>
                                            <th>Price</th>
                                            <th>Total Cost</th>
                                        </tr>
                                        <section th:each="lineItem:${session.order.lineItems}">
                    <!--                    <c:forEach var="lineItem" items="${order.lineItems}">-->
                                            <tr>
                                                <td>
                                                    <a th:href="@{/catalog/viewItem(itemId=${lineItem.item.itemId})}" th:text="${lineItem.item.itemId}">itemId</a>
                                                </td>
                                                <td>
                                                    <p th:if ="${lineItem.item} ne null">
                                                    <p th:text="${lineItem.item.attribute1}"></p>
                    <!--                                    ${lineItem.item.attribute1}-->
                    <!--                                    ${lineItem.item.attribute2}-->
                    <!--                                    ${lineItem.item.attribute3}-->
                    <!--                                    ${lineItem.item.attribute4}-->
                    <!--                                    ${lineItem.item.attribute5}-->
                    <!--                                    ${lineItem.item.product.name}-->
                                                    </p>
                                            <p th:if ="${lineItem.item} eq null">
                    <!--                                <tr test="${lineItem.item == null}">-->
                                                        <i >{description unavailable}</i>
                                                    </p>
                                                </td>

                                                <td th:text="${lineItem.quantity}" >quantity</td>

                                            <td th:text="'$'+${#numbers.formatDecimal(lineItem.unitPrice,1,'COMMA',2,'POINT')}">money</td>
                    <!--                            <fmt:formatNumber value="${lineItem.unitPrice}"-->
                    <!--                                                  pattern="$#,##0.00" />-->

                                            <td th:text="'$'+${#numbers.formatDecimal(lineItem.total,1,'COMMA',2,'POINT')}">money</td>
                    <!--                            <td><fmt:formatNumber value="${lineItem.total}"-->
                    <!--                                                  pattern="$#,##0.00" /></td>-->
                                            </tr>
                    <!--                    </c:forEach>-->
                                        </section>
                                        <tr>
                                            <td colspan="5">Total:</td>
                                        </tr>
                                        <tr>
                                            <td th:text="'$'+${#numbers.formatDecimal(session.order.totalPrice,1,'COMMA',2,'POINT')}">money</td>
                    <!--                            <fmt:formatNumber-->
                    <!--                                value="${order.totalPrice}" pattern="$#,##0.00" />-->
                                        </tr>

                                        </tr>
                                    </table>
                                </td>
                            </tr>

                        </table>
                            <div style="clear: both;"></div>
                            <div style="text-align: center;">
                                <button><a th:href="@{/manage/orderControl}" id="return" >RETURN</a></button>

                            </div>

                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
                        <div class="footer" th:include="footer :: copyright"></div>
                    </div>
</div>
                <!-- Mainly scripts -->
                <script th:src="@{../../js/jquery-2.1.1.js}"></script>
                <script th:src="@{../../js/bootstrap.min.js}"></script>
                <script th:src="@{../../js/plugins/metisMenu/jquery.metisMenu.js}"></script>
                <script th:src="@{../../js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>

                <!-- Peity -->
                <script th:src="@{../../js/plugins/peity/jquery.peity.min.js}"></script>

                <!-- Custom and plugin javascript -->
                <script th:src="@{../../js/inspinia.js}"></script>
                <script th:src="@{../../js/plugins/pace/pace.min.js}"></script>

                <!-- iCheck -->
                <script th:src="@{../../js/plugins/iCheck/icheck.min.js}"></script>

                <!-- Peity -->
                <script th:src="@{../../js/demo/peity-demo.js}"></script>

                <!-- FooTable -->
                <script th:src="@{../../js/plugins/footable/footable.all.min.js}"></script>

                <!-- common -->
                <script th:src="@{../../js/common.js}"></script>


                <!-- datepicker -->
                <script th:src="@{../../js/bootstrap.js}"></script>
                <script th:src="@{../../js/bootstrap.min.js}"></script>
                <script th:src="@{../../js/bootstrap-datetimepicker.js}"></script>
                <script th:src="@{../../js/locales/bootstrap-datetimepicker.zh-CN.js}"></script>



                <script th:inline="javascript">
                    $("#minOrderTimeStr").datetimepicker({
                        format: "yyyy-mm-dd",
                        autoclose: true,
                        todayBtn: true,
                        todayHighlight: true,
                        showMeridian: true,
                        pickerPosition: "bottom-left",
                        language: 'zh-CN',//中文，需要引用zh-CN.js包
                        startView: 2,//月视图
                        minView: 2//日期时间选择器所能够提供的最精确的时间选择视图
                    });

                    $("#maxOrderTimeStr").datetimepicker({
                        format: "yyyy-mm-dd",
                        autoclose: true,
                        todayBtn: true,
                        todayHighlight: true,
                        showMeridian: true,
                        pickerPosition: "bottom-left",
                        language: 'zh-CN',//中文，需要引用zh-CN.js包
                        startView: 2,//月视图
                        minView: 2//日期时间选择器所能够提供的最精确的时间选择视图
                    });
                </script>

</body>
</html>